#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;

const int N=5;

int getValue(char *str)
{
	char *p = str;
	int sum = 0;
	
	while(*p)
	{
		if(*p<'0' || *p>'9')
			return -1;
		else
		{
			sum = sum*10 + *p - '0';
		}
		p++;
	}
	
	return sum;
}

int main()
{
	char buffer[500];
	
	
	int array[N];
	char temp[4][50];
	int maxIndex = -1;
	int i;
	
	while(cin.getline(buffer,1000))
	{
		maxIndex = -1;
		
		sscanf(buffer,"%s %s %s %s",temp[0],temp[1],temp[2],temp[3] );
		array[1] = getValue(temp[0]);
		array[2] = getValue(temp[1]);
		array[3] = getValue(temp[2]);
		array[4] = getValue(temp[3]);
		
		for(i=1; i<N; i++)
		{
			if(array[i]<0 || array[i]>150)
				continue;
			else
			{
				if(-1 == maxIndex)
				{
					maxIndex = i;
				}
				else
				{
					if(array[i] > array[maxIndex])
						maxIndex = i;
				}
			}
		}
		
		printf("%d\n", maxIndex);
		
	}


	return 0;
	
} 


 $STORM_HOME/lib/storm-core-1.0.2.jar: $STORM_HOME/lib/kryo-3.0.3.jar:$STORM_HOME/lib/reflectasm-1.10.1.jar:$STORM_HOME/lib/asm-5.0.3.jar:$STORM_HOME/lib/minlog-1.3.0.jar:$STORM_HOME/lib/objenesis-2.1.jar:$STORM_HOME/lib/clojure-1.7.0.jar:$STORM_HOME/lib/disruptor-3.3.2.jar:$STORM_HOME/lib/log4j-api-2.1.jar:$STORM_HOME/lib/log4j-core-2.1.jar:$STORM_HOME/lib/log4j-slf4j-impl-2.1.jar:$STORM_HOME/lib/slf4j-api-1.7.7.jar:$STORM_HOME/lib/log4j-over-slf4j-1.6.6.jar:$STORM_HOME/lib/servlet-api-2.5.jar:$STORM_HOME/lib/storm-rename-hack-1.0.2.jar
